/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.support.cservice;

import android.content.Context;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageView;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.support.d.a;

public class CustProgressBar extends FrameLayout {
    private ImageView a;
    private Context b;

    public CustProgressBar(Context paramContext, String paramString) {
        super(paramContext);
        this.b = paramContext;
        this.a = new ImageView(paramContext);
        FrameLayout.LayoutParams localLayoutParams = new FrameLayout.LayoutParams(s.b(paramContext, 20.0F), s.b(
                paramContext, 20.0F));
        localLayoutParams.gravity = 17;
        this.a.setLayoutParams(localLayoutParams);
        addView(this.a);
    }

    private void c() {
        a.a(this.b).a(this.a, 1073741863);
        RotateAnimation localRotateAnimation = new RotateAnimation(0.0F, 360.0F, 1, 0.5F, 1, 0.5F);
        localRotateAnimation.setRepeatCount(-1);
        localRotateAnimation.setDuration(1000L);
        localRotateAnimation.setInterpolator(new LinearInterpolator());
        this.a.setAnimation(localRotateAnimation);
    }

    public void a() {
        c();
        this.a.setVisibility(0);
        setVisibility(0);
    }

    public void b() {
        this.a.setVisibility(8);
        this.a.clearAnimation();
        setVisibility(8);
    }
}